#include <bits/stdc++.h>
using namespace std;
  int day[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  bool check(int year)
  {
    if((year%4==0&&year%100!=0)||(year%400==0))
    {
      return true;
    }
    return false;
  }

int main()
{
  int ans=0;
  int w=6;
  for(int y=2000;y<=2020;++y)
  {
    if(check(y))
      day[2]=29;
    else day[2]=28;
    for(int m=1;m<=(y==2020?10:12);++m)
    {
    	if(y==2020&&m==10) day[m]=1;
      for(int d=1;d<=day[m];++d)
      {
        if(d==1||w==1)
        {
          ans+=2;
        }
        else
          ans+=1;
        w=(w+1)%7;
      }
    }
  }
  cout<<ans;
  return 0;
}
